import { UploadCallBack } from '#/global';

export function firstUploadImage(callback?: UploadCallBack[]): string {
  if (callback && callback.length > 0) {
    const percent = callback[0].percent;
    if (percent != 100) {
      return '';
    }
    return callback[0].response;
  }
  return '';
}

export function allUploadImage(callback?: UploadCallBack[]): string[] {
  if (callback && callback.length > 0) {
    return callback.map((callback) => {
      const percent = callback.percent;
      if (percent != 100) {
        return '';
      }
      return callback.response;
    });
  }
  return [];
}
